fix(vm): Make mac_address computed, fix #339 #354
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fields
network_interface_names
,ipv4_addresses
andipv6_addresses
are sometimes be markedcomputed
again, usingCustomizeDiff
. Changes inVMStarted
orVMNetworkDevice
attributes invalidate those values. Marking fieldscomputed
again avoids stale values.network_device
configuration block withoutmac_address
results in MAC address set to its default value (an empty string). Terraform state expectsmac_address
to be an empty string, server provides the actual (random) MAC address of the network device. Terraform detects there are changes to be made, but because ofDiffSuppressFunc
onmac_address
they are hidden from the user, but not from d.HasChange(mkResourceVirtualEnvironmentVMNetworkDevice)By making
mac_address
alsocomputed
, the server-generated MAC address is stored locally, avoiding spurious changes that trigger re-computation ofnetwork_interface_names
,ipv4_addresses
andipv6_addresses
.Contributor's Note
Please mark the following items with an [x] if they apply to your PR.
Leave the [ ] if they are not applicable, or if you have not completed the item.
/docs
for any user-facing features or additions./examples
for any new or updated resources / data sources.make examples
to verify that the change works as expected.Community Note
Relates OR Closes #339